Rules for integrands of the form ((Trig[d+e x])^m)(((a+b ((Cos[d+e x])^p)+c ((Sin[d+e x])^q)))^n)

1.  ∫((Sin[d+e x])^m)(((a+b ((Cos[d+e x])^p)+c ((Sin[d+e x])^q)))^n)dx  when  (m/2)∈ℤ ∧ (p/2)∈ℤ ∧ (q/2)∈ℤ ∧ n∈ℤ

1:  ∫((Sin[d+e x])^m)(((a+b ((Cos[d+e x])^p)+c ((Sin[d+e x])^q)))^n)dx  when  (m/2)∈ℤ ∧ (p/2)∈ℤ ∧ (q/2)∈ℤ ∧ n∈ℤ ∧ 0<p≤q

Derivation: Integration by substitution

Basis: ((Cos[z])^2)==(((Cot[z])^2)/(1+((Cot[z])^2)))

Basis: ((Sin[z])^2)==(1/(1+((Cot[z])^2)))

Basis: If (m/2)∈ℤ, then ((Sin[d+e x])^m)F[((Cos[d+e x])^2),((Sin[d+e x])^2)]==-(1/e)Subst[((F[((x^2)/(1+(x^2))),(1/(1+(x^2)))])/(((1+(x^2)))^(m/2+1))),x,Cot[d+e x]](∂_x)Cot[d+e x]

Rule: If (m/2)∈ℤ ∧ (p/2)∈ℤ ∧ (q/2)∈ℤ ∧ n∈ℤ ∧ 0<p≤q, then

∫((Sin[d+e x])^m)(((a+b ((Cos[d+e x])^p)+c ((Sin[d+e x])^q)))^n)dx  ⟶  -(1/e)Subst[∫((((c+b (x^p) (((1+(x^2)))^((q/2)-(p/2)))+a (((1+(x^2)))^(q/2))))^n)/(((1+(x^2)))^(m/2+n q/2+1)))dx,x,Cot[d+e x]]

Program code:

Int[sin[d_.+e_.*x_]^m_*(a_+b_.*cos[d_.+e_.*x_]^p_+c_.*sin[d_.+e_.*x_]^q_)^n_,x_Symbol] :=
  Module[{f=FreeFactors[Cot[d+e*x],x]},
  -f/e*Subst[Int[ExpandToSum[c+b*(1+f^2*x^2)^(q/2-p/2)+a*(1+f^2*x^2)^(q/2),x]^n/(1+f^2*x^2)^(m/2+n*q/2+1),x],x,Cot[d+e*x]/f]] /;
FreeQ[{a,b,c,d,e},x] && IntegerQ[m/2] && IntegerQ[p/2] && IntegerQ[q/2] && IntegerQ[n] && GtQ[p,0] && LeQ[p,q]

Int[cos[d_.+e_.*x_]^m_*(a_+b_.*sin[d_.+e_.*x_]^p_+c_.*cos[d_.+e_.*x_]^q_)^n_,x_Symbol] :=
  Module[{f=FreeFactors[Tan[d+e*x],x]},
  f/e*Subst[Int[ExpandToSum[c+b*(1+f^2*x^2)^(q/2-p/2)+a*(1+f^2*x^2)^(q/2),x]^n/(1+f^2*x^2)^(m/2+n*q/2+1),x],x,Tan[d+e*x]/f]] /;
FreeQ[{a,b,c,d,e},x] && IntegerQ[m/2] && IntegerQ[p/2] && IntegerQ[q/2] && IntegerQ[n] && GtQ[p,0] && LeQ[p,q]

2:  ∫((Sin[d+e x])^m)(((a+b ((Cos[d+e x])^p)+c ((Sin[d+e x])^q)))^n)dx  when  (m/2)∈ℤ ∧ (p/2)∈ℤ ∧ (q/2)∈ℤ ∧ n∈ℤ ∧ 0<q<p

Derivation: Integration by substitution

Basis: ((Cos[z])^2)==(((Cot[z])^2)/(1+((Cot[z])^2)))

Basis: ((Sin[z])^2)==(1/(1+((Cot[z])^2)))

Basis: If (m/2)∈ℤ, then ((Sin[d+e x])^m)F[((Cos[d+e x])^2),((Sin[d+e x])^2)]==-(1/e)Subst[((F[((x^2)/(1+(x^2))),(1/(1+(x^2)))])/(((1+(x^2)))^(m/2+1))),x,Cot[d+e x]](∂_x)Cot[d+e x]

Rule: If (m/2)∈ℤ ∧ (p/2)∈ℤ ∧ (q/2)∈ℤ ∧ n∈ℤ ∧ 0<q<p, then

∫((Sin[d+e x])^m)(((a+b ((Cos[d+e x])^p)+c ((Sin[d+e x])^q)))^n)dx  ⟶  -(1/e)Subst[∫((((a (((1+(x^2)))^(p/2))+b (x^p)+c (((1+(x^2)))^((p/2)-(q/2)))))^n)/(((1+(x^2)))^(m/2+n p/2+1)))dx,x,Cot[d+e x]]

Program code:

Int[sin[d_.+e_.*x_]^m_*(a_+b_.*cos[d_.+e_.*x_]^p_+c_.*sin[d_.+e_.*x_]^q_)^n_,x_Symbol] :=
  Module[{f=FreeFactors[Cot[d+e*x],x]},
  -f/e*Subst[Int[ExpandToSum[a*(1+f^2*x^2)^(p/2)+b*f^p*x^p+c*(1+f^2*x^2)^(p/2-q/2),x]^n/(1+f^2*x^2)^(m/2+n*p/2+1),x],x,
    Cot[d+e*x]/f]] /;
FreeQ[{a,b,c,d,e},x] && IntegerQ[m/2] && IntegerQ[p/2] && IntegerQ[q/2] && IntegerQ[n] && LtQ[0,q,p]

Int[cos[d_.+e_.*x_]^m_*(a_+b_.*sin[d_.+e_.*x_]^p_+c_.*cos[d_.+e_.*x_]^q_)^n_,x_Symbol] :=
  Module[{f=FreeFactors[Tan[d+e*x],x]},
  f/e*Subst[Int[ExpandToSum[a*(1+f^2*x^2)^(p/2)+b*f^p*x^p+c*(1+f^2*x^2)^(p/2-q/2),x]^n/(1+f^2*x^2)^(m/2+n*p/2+1),x],x,
    Tan[d+e*x]/f]] /;
FreeQ[{a,b,c,d,e},x] && IntegerQ[m/2] && IntegerQ[p/2] && IntegerQ[q/2] && IntegerQ[n] && LtQ[0,q,p]

2.  ∫((Cos[d+e x])^m)(((a+b ((Cos[d+e x])^p)+c ((Sin[d+e x])^q)))^n)dx  when  (m/2)∈ℤ ∧ (p/2)∈ℤ ∧ (q/2)∈ℤ ∧ n∈ℤ

1:  ∫((Cos[d+e x])^m)(((a+b ((Cos[d+e x])^p)+c ((Sin[d+e x])^q)))^n)dx  when  (m/2)∈ℤ ∧ (p/2)∈ℤ ∧ (q/2)∈ℤ ∧ n∈ℤ ∧ 0<p≤q

Derivation: Integration by substitution

Basis: ((Cos[z])^2)==(((Cot[z])^2)/(1+((Cot[z])^2)))

Basis: ((Sin[z])^2)==(1/(1+((Cot[z])^2)))

Basis: If (m/2)∈ℤ, then ((Cos[d+e x])^m)F[((Cos[d+e x])^2),((Sin[d+e x])^2)]==-(1/e)Subst[((F[((x^2)/(1+(x^2))),(1/(1+(x^2)))])/(((1+(x^2)))^(m/2+1))),x,Cot[d+e x]](∂_x)Cot[d+e x]

Rule: If (m/2)∈ℤ ∧ (p/2)∈ℤ ∧ (q/2)∈ℤ ∧ n∈ℤ ∧ 0<p≤q, then

∫((Cos[d+e x])^m)(((a+b ((Cos[d+e x])^p)+c ((Sin[d+e x])^q)))^n)dx  ⟶  -(1/e)Subst[∫((((c+b (x^p) (((1+(x^2)))^((q/2)-(p/2)))+a (((1+(x^2)))^(q/2))))^n)/(((1+(x^2)))^(m/2+n q/2+1)))dx,x,Cot[d+e x]]

Program code:

Int[sin[d_.+e_.*x_]^m_*(a_+b_.*cos[d_.+e_.*x_]^p_+c_.*sin[d_.+e_.*x_]^q_)^n_,x_Symbol] :=
  Module[{f=FreeFactors[Cot[d+e*x],x]},
  -f/e*Subst[Int[ExpandToSum[c+b*(1+f^2*x^2)^(q/2-p/2)+a*(1+f^2*x^2)^(q/2),x]^n/(1+f^2*x^2)^(m/2+n*q/2+1),x],x,Cot[d+e*x]/f]] /;
FreeQ[{a,b,c,d,e},x] && IntegerQ[m/2] && IntegerQ[p/2] && IntegerQ[q/2] && IntegerQ[n] && GtQ[p,0] && LeQ[p,q]

Int[cos[d_.+e_.*x_]^m_*(a_+b_.*sin[d_.+e_.*x_]^p_+c_.*cos[d_.+e_.*x_]^q_)^n_,x_Symbol] :=
  Module[{f=FreeFactors[Tan[d+e*x],x]},
  f/e*Subst[Int[ExpandToSum[c+b*(1+f^2*x^2)^(q/2-p/2)+a*(1+f^2*x^2)^(q/2),x]^n/(1+f^2*x^2)^(m/2+n*q/2+1),x],x,Tan[d+e*x]/f]] /;
FreeQ[{a,b,c,d,e},x] && IntegerQ[m/2] && IntegerQ[p/2] && IntegerQ[q/2] && IntegerQ[n] && GtQ[p,0] && LeQ[p,q]

2:  ∫((Cos[d+e x])^m)(((a+b ((Cos[d+e x])^p)+c ((Sin[d+e x])^q)))^n)dx  when  (m/2)∈ℤ ∧ (p/2)∈ℤ ∧ (q/2)∈ℤ ∧ n∈ℤ ∧ 0<q<p

Derivation: Integration by substitution

Basis: ((Cos[z])^2)==(((Cot[z])^2)/(1+((Cot[z])^2)))

Basis: ((Sin[z])^2)==(1/(1+((Cot[z])^2)))

Basis: If (m/2)∈ℤ, then ((Sin[d+e x])^m)F[((Cos[d+e x])^2),((Sin[d+e x])^2)]==-(1/e)Subst[((F[((x^2)/(1+(x^2))),(1/(1+(x^2)))])/(((1+(x^2)))^(m/2+1))),x,Cot[d+e x]](∂_x)Cot[d+e x]

Rule: If (m/2)∈ℤ ∧ (p/2)∈ℤ ∧ (q/2)∈ℤ ∧ n∈ℤ ∧ 0<q<p, then

∫((Cos[d+e x])^m)(((a+b ((Cos[d+e x])^p)+c ((Sin[d+e x])^q)))^n)dx  ⟶  -(1/e)Subst[∫((((a (((1+(x^2)))^(p/2))+b (x^p)+c (((1+(x^2)))^((p/2)-(q/2)))))^n)/(((1+(x^2)))^(m/2+n p/2+1)))dx,x,Cot[d+e x]]

Program code:

Int[sin[d_.+e_.*x_]^m_*(a_+b_.*cos[d_.+e_.*x_]^p_+c_.*sin[d_.+e_.*x_]^q_)^n_,x_Symbol] :=
  Module[{f=FreeFactors[Cot[d+e*x],x]},
  -f/e*Subst[Int[ExpandToSum[a*(1+f^2*x^2)^(p/2)+b*f^p*x^p+c*(1+f^2*x^2)^(p/2-q/2),x]^n/(1+f^2*x^2)^(m/2+n*p/2+1),x],x,
    Cot[d+e*x]/f]] /;
FreeQ[{a,b,c,d,e},x] && IntegerQ[m/2] && IntegerQ[p/2] && IntegerQ[q/2] && IntegerQ[n] && LtQ[0,q,p]

Int[cos[d_.+e_.*x_]^m_*(a_+b_.*sin[d_.+e_.*x_]^p_+c_.*cos[d_.+e_.*x_]^q_)^n_,x_Symbol] :=
  Module[{f=FreeFactors[Tan[d+e*x],x]},
  f/e*Subst[Int[ExpandToSum[a*(1+f^2*x^2)^(p/2)+b*f^p*x^p+c*(1+f^2*x^2)^(p/2-q/2),x]^n/(1+f^2*x^2)^(m/2+n*p/2+1),x],x,
    Tan[d+e*x]/f]] /;
FreeQ[{a,b,c,d,e},x] && IntegerQ[m/2] && IntegerQ[p/2] && IntegerQ[q/2] && IntegerQ[n] && LtQ[0,q,p]